package b3.widget.home.bottom
{
	import b3.config.*;
	import b3.model.*;
	import b3.net.*;
	import b3.util.*;
	
	import flash.display.*;
	import flash.filters.*;
	import flash.geom.*;
	import flash.text.*;

	public class FriendMessage extends Sprite
	{
		private var textField:TextField;
		
		public function FriendMessage(friendId:int)
		{
			super();
			var PopoutMsgBgr:Class = ResourceHelper.getInstance().getClassByName("PopoutMsgBgr2");
			var mainSprite:Sprite = new PopoutMsgBgr();
			addChild(mainSprite);

			textField = new TextField();
			textField.selectable = false;
			textField.multiline = true;
        	textField.autoSize = TextFieldAutoSize.LEFT;
			textField.defaultTextFormat = new TextFormat(BFont.fontName, 18, 0xFFFFFF, true);
			textField.filters = [new GlowFilter(0x00AAFF, 1, 1.3, 1.3, 100, BitmapFilterQuality.HIGH)];
			textField.x = 20;
			textField.y = 20; 
			addChild(textField);
//			var packageModel:PackageModel = new PackageModel();
//			packageModel.ownerId = friendId;
//			packageModel.addEventListener(ModelEvent.REFRESH, onRefresh);
//			packageModel.loadObjects();
		}
		
//		public function onRefresh(event:ModelEvent):void
//		{
//			var packageModel:PackageModel = event.target as PackageModel;
//			textField.htmlText = "人口: " + packageModel.getObjectNum(ObjConfig.POPULATION)
//			 + "<br>金钱: " + packageModel.getObjectNum(ObjConfig.GOLDCOIN)
//			 + "<br>光明:" + packageModel.getObjectNum(ObjConfig.LIGHT)
//			 + "<br>黑暗:" + packageModel.getObjectNum(ObjConfig.DARK);
//		}
	}
}